<!--This template is used for Paged-Comments Plugin,it can Breaks down comments into a number of pages. You can download it here:http://www.keyvan.net/code/paged-comments/-->
<?php	// Do not delete these lines
if ('comments.php' == basename($_SERVER['SCRIPT_FILENAME']))
{
	die ('Please do not load this page directly. Thanks!');
}
if (!empty($post->post_password))
{
	// if there's a password
	if ($_COOKIE['wp-postpass_' . COOKIEHASH] != $post->post_password)
	{
		// and it doesn't match the cookie
		?>
<p class="nocomments"><?php _e("This post is password protected. Enter the password to view comments."); ?></p>
		<?php
		return;
	}
}
?>

<div id="commentblock" class="commentblock">

<h3 id="comments" class="comments"><?php comments_number(__('No Comments','apple4us'), __('1 Comment so far','apple4us'), __('% Comments so far','apple4us')); ?></h3>

<ol class="commentlist" id="commentlist"><!--begin comments list-->

	<?php if ($comments) : ?>
	
		<?php foreach ($comments as $comment) : ?>
<?php $comment_type = get_comment_type(); ?>
<?php if($comment_type == 'comment') { ?>
			<?php
			$isByAuthor = false;
			if($comment->user_id != 0)
			{
				$isByAuthor = true;
			}
			if ('comment-entry-alt' == $oddcomment && $isByAuthor == true)
			{
				$oddcomment = 'comment-entry-owner';
			}
			if ('comment-entry-alt' != $oddcomment && $isByAuthor == true)
			{
				$oddcomment = 'comment-entry-owner';
			}
			elseif ('comment-entry-alt' == $oddcomment && $isByAuthor == false)
			{
				$oddcomment = 'comment-content';
			}
			else
			{
				$oddcomment = 'comment-content';
			}
			?>

<li class="feedback-content" id="comment-<?php comment_ID() ?>"><!-- Begin each comment-->
<div class="feedback-gravatar">
<?php if (function_exists('get_avatar')) : ?>
<?php echo get_avatar(get_comment_author_email(),'40'); ?>
<?php else : ?>
<?php 
if ( !empty( $comment->comment_author_email ) ) {
        $md5 = md5( $comment->comment_author_email );
        $default = urlencode( 'images/gravatar.png');
        echo "<img src='http://www.gravatar.com/avatar.php?gravatar_id=$md5&amp;size=30&amp;default=$default' alt='<?php _e('Gravatar Icon','apple4us'); ?>' width='40' />";
}
?>
<?php endif; ?>
</div>
<div class="<?php _e($oddcomment); ?>">
<?php comment_text();?>
</div>


<div id="eachcontent" class="feedback-footer">
<span class="feedback-title"></a>&nbsp;<?php comment_author_link() ?></span> @ <?php comment_date(); ?>,<?php comment_time(); ?>(<a href="#comment-<?php comment_ID() ?>" title="<?php _e('Permalink to this comment','apple4us'); ?>">#</a>)<?php edit_comment_link('edit','',''); ?></div>

		<?php if ($comment->comment_approved == '0') : ?>
		<div id="comments-guidelines-info"><?php _e('Your comment has been submitted. It is now awaiting approval.','apple4us'); ?></div>
		<?php endif; ?>
		</li>
		<?php } else { $trackback = true; } ?>
	<?php endforeach; /* end for each comment */ ?>

</ol><!--end for comment list-->

<!-- Comment page numbers -->
<?php if ($paged_comments->pager->num_pages() > 1): ?>
<p class="comment-page-numbers"><?php _e("Pages:"); ?> <?php paged_comments_print_pages(); ?></p>
<?php endif; ?>
<!-- End comment page numbers -->

<!--begin trackback and pingback list-->
<?php if ($trackback == true) { ?>
<h3 class="trackpingstitle"><?php _e('Trackbacks/Pingbacks.','apple4us'); ?></h3>
<div class="trackbacks-content">
<?php foreach ($comments as $comment) : ?>
<?php $comment_type = get_comment_type(); ?>
<?php if($comment_type != 'comment') { ?>
<div class="trackback-content"><?php comment_author_link() ?></div>
<?php } ?>
<?php endforeach; ?>
</div>
<?php } ?>
<!--end trackback and pingback list-->

<?php else : // this is displayed if there are no comments so far ?>

		<?php if ('open' == $post->comment_status) : ?>
		
		<li id="hidelist" style="display:none;"></li>

	</ol>

<h4 id="nocomment"><?php _e('Be the first to comment on this entry.','apple4us'); ?></h4>

	<?php else : // comments are closed ?>
	
		<li style="display:none"></li>
	</ol>

	<div id="comments-guidelines-info">
		<p><?php _e('Sorry, comments are closed for this item.','apple4us'); ?></p>
	</div>

	<?php endif; ?>

<?php endif; ?>

<div id="loading" style="display:none;"><?php _e('Posting your comment&hellip;','apple4us'); ?></div>
<div id="errors" style="display:none;"></div>

<?php if ('open' == $post-> comment_status) : ?>

<div class="comments-form" id="comments-form">	
<h3 name="respond" class="comments-form-header"><?php _e ('Leave a comment','apple4us'); ?></h3>
<div class="comments-form-content">
		<?php if (get_option('comment_registration') && !$user_ID ) : ?>
		<p id="comments-blocked"><?php _e('You must be','apple4us'); ?> <a href="<?php echo get_option('siteurl'); ?>/wp-login.php?redirect_to=<?php the_permalink(); ?>"><?php _e('logged in','apple4us'); ?></a> <?php _e('to post a comment.','apple4us'); ?></p></div>
</div><!--end for comments-form-content-->

<?php else : ?>


<form id="commentform" action="<?php echo get_option('siteurl'); ?>/wp-comments-post.php" method="post" onsubmit="new Ajax.Updater({success: 'commentlist'}, '<?php bloginfo('stylesheet_directory') ?>/comments-ajax.php', {asynchronous: true, evalScripts: true, insertion: Insertion.Bottom, onComplete: function(request){complete(request)}, onFailure: function(request){failure(request)}, onLoading: function(request){loading()}, parameters: Form.serialize(this)}); return false;">

<?php if ($user_ID) : ?>
	
<?php // don't display form user info ?>
			
<?php else : ?>


<div id="commentform" class="comment-form">
<input id="author" name="author" class="comment-input" value="<?php echo $comment_author; ?>" /> <?php _e('Name','apple4us'); ?><strong><?php _e('(required)','apple4us'); ?></strong></div>

<div id="commentform" class="comment-form">
<input id="email" name="email" class="comment-input" value="<?php echo $comment_author_email; ?>" /> <?php _e('Mail (will not be published)','apple4us'); ?><strong><?php _e('(required)','apple4us'); ?></strong></div>

<div id="commentform" class="comment-form">
<input id="url" name="url" class="comment-input" value="<?php echo $comment_author_url; ?>" /> <?php _e('Website','apple4us'); ?></div>


<?php endif; ?>

<div class="comment-form">
<div class="quicktags"><script type="text/javascript">displayQuicktags('comment');</script></div>
<textarea id="comment" name="comment" rows="6" cols="50"></textarea>
</div>

<p>
<input type="submit" id="submit" name="submit" value="<?php _e('Submit Comment','apple4us'); ?>" />
<input type="hidden" name="comment_post_ID" value="<?php echo $id; ?>" />
<?php do_action('comment_form', $post->ID); ?>
</p>
</form>

<div id="comments-guidelines">
<?php if ($user_ID) : ?>
<p><?php _e('Logged in as','apple4us'); ?> <a href="<?php echo get_option('siteurl'); ?>/wp-admin/profile.php" title="<?php _e('Logged in as','apple4us'); ?> <?php echo $user_identity; ?>"><?php echo $user_identity; ?></a>. <a href="<?php echo get_option('siteurl'); ?>/wp-login.php?action=logout" title="<?php _e('Log out of this account','apple4us'); ?>"><?php _e('Logout &raquo;','apple4us'); ?></a></p>
<?php else : ?>
<div id="comments-guidelines-info">
<p><?php _e('Fields in','apple4us'); ?> <strong style="color:#000;"><?php _e('bold','apple4us');?></strong> <?php _e('are required. Email addresses are','apple4us'); ?> <strong><?php _e('never','apple4us'); ?></strong> <?php _e('published or distributed.','apple4us'); ?></p>
<p><?php _e('Some HTML code is allowed:','apple4us'); ?><br /><code><?php echo allowed_tags(); ?></code><br />
<?php _e('URLs must be fully qualified','apple4us'); ?> (<?php _e('eg:','apple4us'); ?> <strong><?php echo get_option('home'); ?>)</strong>,<?php _e('and all tags must be properly closed.','apple4us'); ?></p>
<p><?php _e('Line breaks and paragraphs are automatically converted.','apple4us'); ?></p>
<p><?php _e('Please keep comments relevant. Off-topic, offensive or inappropriate comments','apple4us'); ?> <em><?php _e('may','apple4us'); ?></em> <?php _e('be edited or removed.','apple4us'); ?></p>
</div> <!--end for comments-guidelines-info-->
<?php endif; ?>
</div><!--end for comments-guidelines-->

	</div>
		<?php endif; // If registration required and not logged in ?>
		
<?php else : ?>

	<div id="comments-guidelines-info">
		<p><?php _e('Sorry, comments are closed for this item.','apple4us'); ?></p>
	</div>

<?php endif; // if you delete this the sky will fall on your head ?>

</div></div>	